package com.itheima;

import com.itheima.mapper.UserMapper;
import com.itheima.pojo.User;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest(classes = MpApplication.class)
public class MpTest1 {

    @Autowired
    private UserMapper userMapper;

    @Test
    public void test1() {
        User user = userMapper.selectById(1);
        System.out.println("user = " + user);
    }

    @Test
    public void testInsert() {
        User user = User.builder()
                .userName("坤哥")
                .age(18)
                .email("kunkun@163.com")
                .password("123456")
                .build();

        int row = userMapper.insert(user);
        System.out.println("row = " + row);
        System.out.println("user = " + user);

    }



}
